package com.ungao.framework.core;

import com.ungao.framework.core.servlet.MiniServlet;

import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.HandlesTypes;
import java.util.Set;

@HandlesTypes(WebApplicationInitializer.class)
public class MiniServletContainerInitializer implements ServletContainerInitializer {

    @Override
    public void onStartup(Set<Class<?>> set, ServletContext servletContext) throws ServletException {

        // 注册Servlet
        servletContext.addServlet("miniServlet", new MiniServlet()).addMapping("/");
    }
}
